OpenUtilities Substation Help

Section and Compartment ID Format in EctRway.xml

When you create layout diagrams for the wiring rules version of the Shortest Distance Routing function, you use special layout symbols for each panel. These symbols must be given a device ID which is used by the program to identify the section and compartment to which the panel belongs. For example, the installation name of a panel symbol can represent the name of the section (unit, stack). The location name could represent a compartment within a section, if your designs make use of compartments.



To set how the how the device ID of your panel symbols corresponds to your naming convention for sections and compartments, use the Wiring Rules Configuration dialog. The settings made here are stored in EctRway.xml located in the Shortest Distance directory of the current project.

In the parameters section of the EctRway.xml file, there are entries using the <IDPattern> tag as shown in the following example.

<!-- Specify what part of the device ID of the panel symbol will hold the Section Name (also referred to as stack or unit)-->

<!-- The example provided looks for any integer in the installation field of the device ID (returns every integer that exists between the '=' and ''+' delimiters in a device ID)-->

<IDPattern1>([0-9]*)\+</IDPattern1>

<!-- Specify what part of the device ID of the panel symbolwill hold the Compartment Name leave blank if not used)-->

<IDPattern2 />

<!-- Specify what part of the device ID of the panel symbol will hold the Panel Name (leave blank if not used) -->

<IDPattern3 />

The IDPattern tags set a "regular expression" using VBScript and ASP.NET syntax. The regular expression defines an pattern that is then compared to a string, in this case a complete device ID including installation and location, for example =installation1+location2-pb123.

Use IDPattern1 to define part of the device ID as the name of the section (unit, stack). In the preceding example, the pattern looks for any integer in the device ID between the = character and the + character, in other words, the installation part of the complete device ID.

Use IDPattern2 if you are using compartments within sections. This tag will define the part of the device ID that will be used for the compartment name. In the preceding example this tag has been left empty, therefore compartments will not be used.

Use IDPattern3 if you wish to specify part of the device ID as a name for the panel symbol. Use of this tag is optional because if you are using the PanelName attribute on the panel symbols the panel name will be provided from there. In the preceding example this tag has been left empty, therefore the panel name must come from the layout symbol PanelName attribute.

Regular Expression Syntax

There are several special metacharacters and sequences to allow you to do complex pattern matching, including the following:

  • ^ - Stands for the beginning of a string , so ^i will match is but not mi.
  • $ - Indicates a match at the end of a string, so $i will match mi but not is.
  • * - Matches the preceding character zero or more times, so the regular expression fo* matches both f and foo. + matches the preceding character one or more times, so fo+ matches foo but not f.
  • ? - The question mark ( ?) matches the preceding character zero or just one time, meaning a?ve? matches the ve in never.
  • . - The period (.) matches any single character except the newline character, so a.b matches aab and a3b, but not ab.
  • | - The bar | is used for alternative matching, as in a|b, which will match either a or b.
  • {} - The expression {n} matches against the target string exactly n times. For example, e{2} will match feed but not fed. The expression {n,m} will match against the target string at least n times but not more than m times. o{1,3} will match all the o's in food or sod, but will only match the first three o's in soooooie.
  • [] - Brackets are used to express character and digit sets and ranges. For example, the expression [abcd] will match any of the enclosed characters in the target string. The whole lower-case alphabet can be expressed using [a-z]. To include both upper and lower-case letters in the regular expression, write the expression like this: [a-zA-Z]. To search for digits in a string, use [0-9].
  • Negative character and digit sets and ranges can also be expressed. [^abc] will match any characters not enclosed in brackets. You can also write an expression for a negative range, such as [^m-q].
Note: In this case the ^ character is inside the brackets, so it does not mean the beginning of a string .